package com.packet.cheng.service;


import com.packet.cheng.dto.UserParamDTO;
import com.packet.cheng.entity.TestUser;
import com.packet.cheng.entity.User;
import com.packet.cheng.util.R;

import java.util.List;

/**
 * @author 张在成
 */
public interface UserService {

    /**
     * 用户登录
     * @param username
     * @param password
     * @return
     */
    R<User>  login(String token, String username, String password) throws Exception;

    /**
     * 新增用户记录
     * @param user
     * @return
     */
    boolean  insertUser(UserParamDTO user) throws Exception;

    /**
     * 查询全部用户
     * @return
     */
    List<User> selectUser();

    /**
     * 查询用户id
     * @param userParamDTO
     * @return
     */
    User  selectUserById(UserParamDTO userParamDTO) throws Exception;

    /**
     * 通过用户名查询用户信息
     * @param username
     * @return
     */
    List<User>  selectUserByName(String username) throws Exception;


    /**
     * 登录认证
     */
    R<User>  loginAuthticate(String token) throws  Exception;


    int  updateUser(User user) throws InterruptedException;

    int  updateTestUser(TestUser user);
}
